<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Utils.Timer" %> 
<%@page import="Utils.GenerateCalcul" %> 
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Hello world</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <%
            int nbIterations;
            if (request.getParameter("nbIteration") == null) {
                return;
            } else {
                nbIterations = Integer.parseInt(request.getParameter("nbIteration"));
            }           
            
            Timer timer = new Timer();
            timer.initTimer();
            for (int i = 0; i<nbIterations; i++){
                GenerateCalcul.calculPi();
            }
            timer.endTimer();
        %>
        <p>Temps de générations : </p><%= timer.getTimeProcess() %>
    </body>
</html>
